class Component:

    def __init__(self, type, **kwargs):
        self.__type = type
        self.__kwargs = kwargs

    @property
    def type(self):
        return self.__type

    @property
    def kwargs(self):
        return self.__kwargs

    def set(self, key, value):
        self.__kwargs[key] = value


class ConfigIR:
    components = (
        "transform",
        "dataloader",
        "model",
        "criteria",
        "optimizer",
        "data_evaluator",
        "loss_evaluator",
        "grad_evaluator",
        "dispatcher"
    )

    def __init__(self):
        self.transform = None
        self.dataloader = None
        self.model = None
        self.criteria = None
        self.optimizer = None
        self.data_evaluator = None
        self.loss_evaluator = None
        self.grad_evaluator = None
        self.dispatcher = None
